const fs = require('fs')
//传统读写
// let data = fs.readFileSync("./CECE.mp4")
// fs.writeFileSync('./复制的文件/cece copy.mp4', data)
// console.log(process.memoryUsage());

// //流读写  切片 边读边写
const rs = fs.createReadStream('./CECE.mp4')
const ws = fs.createWriteStream('./复制的文件/cece copy2.mp4')

// rs.on('data', (chunk) => {
//     ws.write(chunk)
// })
// rs.on('end', () => {
//     console.log(process.memoryUsage());
// })


rs.pipe(ws)